using System;
using System.Collections.Generic;
using UnityEngine;
using QFramework;

namespace ProjectMyFarmAndShe
{
	public partial class Shop : ViewController
	{
		void Start()
		{
			// Code Here
			EventController.Default.GetEvent("OpenBuyShop")
				.Register(() =>
				{
					var shopPanel = UIGameController.Default.OpenShopPanel();
					ActionKit.NextFrame(() =>
						{
							shopPanel.OpenShopBuyItemPanel();
						})
						.StartCurrentScene();
				})
				.UnRegisterWhenGameObjectDestroyed(gameObject);

			EventController.Default.GetEvent("OpenSellShop")
				.Register(() =>
				{
					var shopPanel = UIGameController.Default.OpenShopPanel();
					ActionKit.NextFrame(() =>
						{
							shopPanel.OpenShopSellItemPanel();
						})
						.StartCurrentScene();
					
				})
				.UnRegisterWhenGameObjectDestroyed(gameObject);
		}
	}
}
